package com.example.demo.Controller;

import com.example.demo.Common.Result;
import com.example.demo.Proj.CategoryPageParam;
import com.example.demo.Proj.DishPageParam;
import com.example.demo.Proj.PageReslut;
import com.example.demo.Service.CategoryService;
import com.example.demo.Service.DishService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/dish")
@Slf4j
public class DishController {
    @Autowired
    private DishService dishService;

    @GetMapping("/page")
    public Result getDishPage(DishPageParam dishPageParam){
        log.info("dishPageParam:： " + dishPageParam);
        PageReslut pageReslut = dishService.getDishPage(dishPageParam);
        log.info("pageReslut： " + pageReslut);
        return Result.success(pageReslut);
    }
}
